/************************************************************************/
/* Name : Kiwon Yun
/* Partner's name : Eric Rooney
/* File Name : Player.h
/* The name of assignment : Iteration 2
/************************************************************************/

#ifndef PLAYER_H
#define PLAYER_H

#include "Common.h"
#include "Hand.h"

/************************************************************************/
/* Player class can have a hand and a name.
/* This class can have functions such as request card, accept hand, and so on.
/*
/* Player have a hand automatically in this version.
/* However, it has to be different in next version, 
/* because player can not only select whether join the game or not, 
/* but also fold cards while playing the game.
/************************************************************************/

class Dealer;
class Player
{
public:
	/**	 Constructor */
	Player( Dealer* pDealer );

	/**  Destructor */
	virtual ~Player(void);

	/***********************************************************************
	* Set a player's name.
	************************************************************************/
	void SetPlayerName( const char* a_strPlayerName );

	/***********************************************************************
	* Return a player's name
	************************************************************************/
	char* GetPlayerName();

	/***********************************************************************
	* Return the pointer of hand that player has.
	************************************************************************/
	Hand* GetHand();

	/***********************************************************************
	* Call Showhand() function of the hand.
	************************************************************************/
	void ShowHand();

	/***********************************************************************
	* Ask how many cards to discard, then discard them and request new
	* cards from the dealer.
	************************************************************************/
	int Discard(int m_nCard1,int m_nCard2,int m_nCard3);

	/***********************************************************************
	* Ask how many cards to discard, then discard them and request new
	* cards from the dealer.
	************************************************************************/
	void ReorderCards(int m_nCard1,int m_nCard2,int m_nCard3);

	/***********************************************************************
	* Request a card to dealer
	************************************************************************/
	void RequestCard();

	/***********************************************************************
	* Set holding money.
	************************************************************************/
	void SetMoney( int a_nMoney );

	/***********************************************************************
	* Return holding money.
	************************************************************************/
	int GetMoney();

	/***********************************************************************
	* Set fold status.
	************************************************************************/
	void SetFold(bool a_bFold);

	/***********************************************************************
	* Get fold status.
	************************************************************************/
	bool GetFold();

	/***********************************************************************
	* Set all in status.
	************************************************************************/
	void SetAllIn(bool a_bAllIn);

	/***********************************************************************
	* Get all in status.
	************************************************************************/
	bool GetAllIn();

	/***********************************************************************
	* Set all in amount.
	************************************************************************/
	void SetAllInAmount(int a_bAllInAmount);

	/***********************************************************************
	* Get all in amount.
	************************************************************************/
	int GetAllInAmount();

	/***********************************************************************
	* Set Bet so far amount.
	************************************************************************/
	void SetBetSoFar(int a_bBetSoFar);

	/***********************************************************************
	* Get bet so far amount.
	************************************************************************/
	int GetBetSoFar();


private:
	
	/* The pointer of the deck */
	Hand* m_pHand;
	
	/* The name of player */
	char* m_strPlayerName;

	Dealer* m_pDealer;

	/* The holding money of player */
	int m_nMoney;

	/*Fold status of player */
	bool m_bFold;

	/*All in status of player */
	bool m_bAllIn;

	/*Value of all in bet*/
	int m_bAllInAmount;

	/*Value of money put down so far for this round*/
	int m_bBetSoFar;
};

#endif
